﻿@page "/System/Role"
@namespace MXERP.Client.Pages.Systems
@attribute [Authorize]

<View>
    <ButtonContent>
        <MudButton Variant="Variant.Filled" Color="Color.Primary" StartIcon="@CustomIcon.Fluent.Add" OnClick="Add">添加</MudButton>
        <MudButton Variant="Variant.Filled" Color="Color.Warning" StartIcon="@CustomIcon.Fluent.Edit" OnClick="Edit">修改</MudButton>
        <PopConfirm PositiveClick="Remove" Title="是否删除?" Placement="Placement.Top">
            <MudButton Variant="Variant.Filled" Color="Color.Error" StartIcon="@Icons.Material.Filled.Delete">删除</MudButton>
        </PopConfirm>
    </ButtonContent>
    <ChildContent>
        <Table Items="@Response?.List"
               Outlined
               Class="mud-height-full"
               Height="100%"
               @bind-SelectedItems="SelectedItems">
            <Columns>
                <MXERP.Blazor.Components.SelectColumn T="RoleResponse" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.Name" Title="角色名称" Width="250" Ellipsis StickyLeft />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.Remark" Title="备注" Width="250" Ellipsis />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.CreatedByName" Title="创建人" Width="110" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.CreatedOn" Title="创建时间" Width="170" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.UpdatedByName" Title="更新人" Width="110" />
                <MXERP.Blazor.Components.PropertyColumn Property="x => x.UpdatedOn" Title="更新时间" Width="170" />
            </Columns>
        </Table>
    </ChildContent>
    <PaginationContent>
        <MudPagination Rectangular="true" Variant="Variant.Filled" Selected="Request.PageIndex" Count="Response?.TotalPage ?? 0" SelectedChanged="PageChange" />
    </PaginationContent>
</View>

